package com.hm.system.mongo.domain.system;

import java.util.List;

import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.hm.common.annotation.Validate;
import com.hm.common.annotation.ValidateElement;
import com.hm.common.annotation.ValidateElementSize;
import com.hm.common.model.BaseModel;
import com.hm.system.mongo.domain.def.SysUserDef;
import com.hm.system.mongo.util.SystemMongoDataDef;

import lombok.Getter;
import lombok.Setter;

/**
 * @author shishun.wang
 * @date 2016年5月12日 下午9:34:15
 * @version 1.0
 * @describe
 */
/**
 * @author shishun.wang
 * @date 2016年6月2日 下午11:29:17
 * @version 1.0
 * @describe
 */
@Setter
@Getter
@Validate("msg_sys_user_info_ch.properties")
@Document(collection = SystemMongoDataDef.Db.Mongo.PREFIX + "sys_user_info")
public class SysUserInfo extends BaseModel {

	private static final long serialVersionUID = 1L;

	@Field("user_def")
	private SysUserDef userDef;

	/**
	 * 姓名
	 */
	@ValidateElement(required = true, size = @ValidateElementSize(minSize = 3, maxSize = 32) )
	private String name;

	/**
	 * 密码
	 */
	@ValidateElement(required = true, size = @ValidateElementSize(minSize = 3, maxSize = 32) )
	private String pwd;

	/**
	 * 别名
	 */
	private String alias;

	/**
	 * 头像
	 */
	@Field("head_portrait")
	private String headPortrait;

	/**
	 * 手机
	 */
	@ValidateElement(required = true, size = @ValidateElementSize(length = 11) , regex = "^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$")
	private String mobile;
	
	private String email;
	
	private String alipay;
	
	private String adress;
	
	private String note;

	@Field("role_ids")
	private List<String> roleIds;

}
